using System.Collections.Generic;
using UnityEngine;
using JufTools;
using System;


public class PlayerFSM : StateMachine
{
	[SerializeField]private PlayerState[] allStates;
    private PlayerInput input;
    private PlayerMotor motor;
    private void Awake()
    {
        input = GetComponent<PlayerInput>();
        motor = GetComponent<PlayerMotor>();
    }
    private void Start()
    {
        stateTable = new Dictionary<System.Type, IState>();
        foreach(var state in allStates)
        {
            state.Initialize(input, motor, this);
            stateTable.Add(state.GetType(), state);
        }
        SwitchOn(typeof(PlayerState_Idle));
    }
}
